
 <!-- path page -->
 <div id="boxpathpage" style="margin:0px;">
    	<div style="float:left; width:600px;"><img src="images/home.png" width="24" height="24" style="margin-right:5px;" align="left" />
        <div style="padding-top:7px;">{pathpage}</div>
        </div>
       <div style="float:right; width:150px; border:solid 0px; padding-top:3px"> 
      		<a href="?page={par_page}&amp;pid={pid}&amp;code=01"><img src="./images/folder-add1.png" width="24" height="24" border="0" style="margin-right:5px" title="Thêm mới {cat_name}"/></a>
      		<a href="?page={par_page}&code=11&pid={pid}&pitem={pitem}"><img src="./images/docs-add1.png" width="24" height="24" border="0" style="margin-right:5px" title="Thêm mới {item_name}"/></a>
      </div>
 </div>
 <!-- end path page -->
     <div style="clear:both; height:5px;"></div>
      <!--START BLOCK : msg -->
		<div>
		{msg}		</div>
        <div style="clear:both; height:10px;"></div>
		<!--END BLOCK : msg -->
    <!-- START BLOCK : addnew_cat -->
   
    <div id="titlepage">
        	<div style="float:left"><img src="images/folder-add1.png" width="24" height="24" align="absmiddle" style="margin-right:5px;" />Thêm mới {cat_name}</div>
    </div>
    <div style="clear:both"></div>
    <table width="100%" border="0" class="tableadmin">
   
	    <tr>
	      <td width="150"  colspan="2" style="padding:10px;">
          <form  name="form1" method="post" action="?page={par_page}&pid={pid}&code=02" id="addnewform" onsubmit="return check_null_addnew_category()">
          <div id="borderform" style="width:500px;">
	        <table width="500" border="0" align="center" cellpadding="0" cellspacing="0" class="tableadminform">
	          <tr class="titletable">
	            <th colspan="2">&nbsp;</th>
              </tr>
	          <tr>
	            <td width="150"><strong>Tên {cat_name}</strong></td>
	            <td><input type="text" name="name" id="name" class="textbox" value="{name}"/></td>
              </tr>
	          <tr>
	            <td><strong>Thuộc mục</strong></td>
	            <td>{parentid}</td>
              </tr>
	          <tr>
	            <td><strong>Keywords</strong></td>
	            <td><textarea name="keyword" id="keyword"  rows="5" class="textarea">{keyword}</textarea></td>
              </tr>
	          <tr>
	            <td><strong>Description</strong></td>
	            <td><textarea name="description" id="description" class="textarea" rows="5">{description}</textarea></td>
              </tr>
	          <tr>
	            <td><strong>Thứ tự</strong></td>
	            <td><input type="text" name="thu_tu" id="thu_tu" class="orderbox" value="{thu_tu}" /></td>
              </tr>
	          <tr>
	            <td><strong>Kích hoạt</strong></td>
	            <td><input type="checkbox" name="active" id="active" checked="checked" value="1"/></td>
              </tr>
	          <tr>
	            <td>&nbsp;</td>
	            <td>
                <input type="submit" name="button2" id="button2" value="Chấp nhận" class="btnadmin"/>
                <input name="cancel" type="button" value="Bỏ qua" onclick="window.location='?page={par_page}&pid={pid}&code=00'" class="btnadmin"/>
                </td>
              </tr>
            </table>
          </div>
              <script language="javascript">
              		
						function check_null_addnew_category(){
							if($('#addnewform #name').val()==''){
								alert('Bạn phải nhập vào tiêu tên mục');
								$('#addnewform #name').focus();
								return false;								
							}
						}
					
              </script>
	        </form></td>
	      
      </tr>
        
 </table>
    <div style="clear:both; height:5px;"></div>
    <!-- end new category -->
    <!-- END BLOCK : addnew_cat -->
    
    <!-- START BLOCK : update_cat -->

    <div id="titlepage">
        	<div style="float:left"><img src="images/folder-add1.png" width="24" height="24" align="absmiddle" style="margin-right:5px;" />Thêm mới {cat_name}</div>
    </div>
    <div style="clear:both"></div>
    <table width="100%" border="0" class="tableadmin">
   
	    <tr>
	      <td width="150"  colspan="2" style="padding:10px;">
          <form  name="form1" method="post" action="?page={par_page}&pid={pid}&code=04&id={id}&p={p}&pitem={pitem}" id="addnewform" onsubmit="return check_null_addnew_category()">
          <div id="borderform" style="width:500px;">
	        <table width="500" border="0" align="center" cellpadding="0" cellspacing="0" class="tableadmin">
	          <tr class="titletable">
	            <th colspan="2">&nbsp;</th>
              </tr>
	          <tr>
	            <td width="150"><strong>Tên {cat_name}</strong></td>
	            <td><input type="text" name="name" id="name" class="textbox" value="{name}"/></td>
              </tr>
	          <tr>
	            <td><strong>Thuộc mục</strong></td>
	            <td>{parentid}</td>
              </tr>
	          <tr>
	            <td><strong>Keywords</strong></td>
	            <td><textarea name="keyword" id="keyword"  rows="5" class="textarea">{keyword}</textarea></td>
              </tr>
	          <tr>
	            <td><strong>Description</strong></td>
	            <td><textarea name="description" id="description" class="textarea" rows="5">{description}</textarea></td>
              </tr>
	          <tr>
	            <td><strong>Thứ tự</strong></td>
	            <td><input type="text" name="thu_tu" id="thu_tu" class="orderbox" value="{thu_tu}" /></td>
              </tr>
	          <tr>
	            <td><strong>Kích hoạt</strong></td>
	            <td><input type="checkbox" name="active" id="active" checked="checked" value="1"/></td>
              </tr>
	          <tr>
	            <td>&nbsp;</td>
	            <td><input type="submit" name="button2" id="button2" value="Chấp nhận" class="btnadmin"/>
               <input name="cancel" type="button" value="Bỏ qua" onclick="window.location='?page={par_page}&pid={pid}&code=00'" class="btnadmin"/></td>
              </tr>
            </table>
            </div>
              <script language="javascript">
              		
						function check_null_addnew_category(){
							if($('#addnewform #name').val()==''){
								alert('Bạn phải nhập vào tiêu tên mục');
								$('#addnewform #name').focus();
								return false;								
							}
						}
					
              </script>
	        </form></td>
	      
      </tr>
        
 </table>
    <div style="clear:both; height:5px;"></div>
    <!-- end update category -->
    <!-- END BLOCK : update_cat -->
    
    
    <!-- START BLOCK : addnew_item -->
    <!-- add new item -->
    <div id="titlepage">
        	<div style="float:left"><img src="images/folder-add1.png" width="24" height="24" align="absmiddle" style="margin-right:5px;" />Thêm mới {item_name}</div>
    </div>
   <div style="clear:both"></div>
    <table width="100%" border="0" class="tableadmin">
    <!-- addnew category form -->
	    <tr>
	      <td width="150"  colspan="2" style="padding:10px;">
          <div id="borderform" style="width:800px;">
             <div style="width:400px; position:absolute;" id="upload_form" >
                   
            </div>
          <form  name="form1" method="post" action="index4.php?page=uploadfile_photo" id="addnewitem" onsubmit="return check_null_addnew_item()">
          <input type="hidden" name="addnew" value="1" />
	        <table width="800" border="0" align="center" cellpadding="0" cellspacing="0" class="tableadmin" >
	          <tr class="titletable">
	            <th colspan="2">&nbsp;</th>
              </tr>
	          <tr>
	            <td width="150"><strong>Tên {item_name}</strong></td>
	            <td><input type="text" name="name" id="name" class="textbox" value="{name}" /></td>
              </tr>
	          <tr>
	            <td><strong>Thuộc mục</strong></td>
	            <td>{parentid}</td>
              </tr>
	          <tr>
	            <td><strong>Hình ảnh</strong></td>
	            <td>
                     
             		 <input type="file" name="file" id="btnuploadfile"/>
             
                
                </td>
              </tr>
	          
	          <tr>
	            <td><strong>Thứ tự</strong></td>
	            <td><input type="text" name="thu_tu" id="thu_tu" class="orderbox" value="{thu_tu}"/></td>
              </tr>
	          <tr>
	            <td><strong>Kích hoạt</strong></td>
	            <td><input type="checkbox" name="active" id="active" checked="checked" value="1"/></td>
              </tr>
	          <tr>
	            <td>&nbsp;</td>
	            <td><input type="submit" name="button2" id="button2" value="Chấp nhận" class="btnadmin"/></td>
              </tr>
	          <tr>
	            <td colspan="2"><div id="image_back"></div></td>
              </tr>
              <tr>
	            <td colspan="2"><input name="cancel" type="button" value="Kết thúc" onclick="window.location='?page={par_page}&pid={pid}&code=00'" class="btnadmin"/></td>
              </tr>
            </table>
              <script language="javascript">
              		
						function check_null_addnew_item(){
							if($('#addnewitem #name').val()==''){
								alert('Bạn phải nhập vào tên bài viết');
								$('#addnewitem #name').focus();
								return false;								
							}
						}
					
              </script>
	        </form>
            </div>
          </td>
	      
      </tr>
           <!--end  addnew category form -->
      
 </table>
    <div style="clear:both; height:5px;"></div>
    <!-- END BLOCK : addnew_item -->
    
    
    
    <!-- START BLOCK : update_item -->
    <!-- add new item -->
     <div id="titlepage">
        	<div style="float:left"><img src="images/folder-add1.png" width="24" height="24" align="absmiddle" style="margin-right:5px;" />Sửa {item_name}</div>
    </div>
   <div style="clear:both"></div>
    <table width="100%" border="0" class="tableadmin">
	    <tr>
	      <td width="150"  colspan="2" style="padding:10px;">
          <div id="borderform" style="width:800px;">
             <div style="width:400px; position:absolute;" id="upload_form" >
                   
            </div>
          <form  name="form1" method="post" action="index4.php?page=uploadfile_photo" id="update_item_form" onsubmit="return check_null_addnew_item()">
          <input type="hidden" name="update" value="1" />
          <input type="hidden" name="id" value="{id}" />
	        <table width="800" border="0" align="center" cellpadding="0" cellspacing="0" class="tableadmin" >
	          <tr class="titletable">
	            <th height="40" colspan="2">&nbsp;</th>
              </tr>
	          <tr>
	            <td width="150"><strong>Tên {item_name}</strong></td>
	            <td><input type="text" name="name" id="name" class="textbox" value="{name}" /></td>
              </tr>
	          <tr>
	            <td><strong>Thuộc mục</strong></td>
	            <td>{parentid}</td>
              </tr>
	          <tr>
	            <td><strong>Hình ảnh</strong></td>
	            <td>
                     <div id="image_back">{image}</div>
                     <div style="clear:both"></div>
             		 <input type="file" name="file" id="btnuploadfile"/>
             
                
                </td>
              </tr>
	          
	          <tr>
	            <td><strong>Thứ tự</strong></td>
	            <td><input type="text" name="thu_tu" id="thu_tu" class="orderbox" value="{thu_tu}"/></td>
              </tr>
	          <tr>
	            <td><strong>Kích hoạt</strong></td>
	            <td><input type="checkbox" name="active" id="active" checked="checked" value="1"/></td>
              </tr>
	          <tr>
	            <td>&nbsp;</td>
	            <td><input type="submit" name="button2" id="button2" value="Chấp nhận" class="btnadmin"/><input name="cancel" type="button" value="Bỏ qua" onclick="window.location='?page={par_page}&pid={pid}&code=00'" class="btnadmin"/></td>
              </tr>
            </table>
              <script language="javascript">
              		
						function check_null_addnew_item(){
							if($('#addnewitem #name').val()==''){
								alert('Bạn phải nhập vào tên bài viết');
								$('#addnewitem #name').focus();
								return false;								
							}
						}
					
              </script>
	        </form>
            </div>
          </td>
	      
      </tr>
 </table>
    <div style="clear:both; height:5px;"></div>
    <!-- END BLOCK : update_item -->
    
    
    <!-- end new item -->
    <!-- START BLOCK : show_category -->
    <!-- table -->
    <form name="listitem" action="?page={par_page}&pid={pid}&code=05" method="post">
    	<div id="titlepage">
        	<div style="float:left"><img src="images/folder.png" width="24" height="24" align="absmiddle" style="margin-right:5px;" />Danh sách danh mục</div>
            <div id="btnaddnewfolder"><a href="?page={par_page}&amp;pid={pid}&amp;code=01">Thêm mới {cat_name} </a></div>
        </div>
        <div style="clear:both"></div>
        
   	  <table width="100%" border="0" id="tablelist">
       	
     <thead>
        <tr class="searchbar">
            <th width="40"><input name="" type="checkbox" value=""  class="checkallitem" /></th>
            <th>
                <div style="float:left; ">&nbsp;Tên mục</div>
                <div id="filter" style="float:right"></div>
            </th>
            <th width="60">Kích hoạt</th>
            <th width="60">Thứ tự</th>
            <th width="50">Sửa</th>
            <th width="50">Xóa</th>
        </tr>
	</thead>

   
          <!-- START BLOCK : list_cat -->
          <tr>
            <td align="center"><input name="delall[{id_category}]" type="checkbox" value="" class="selectitem" /></td>
            <td><a href="{linkcat}"><img src="images/folder16.png" width="16" height="16" border="0" align="left" style="margin-right:5px;" />{name}</a>
            </td>
            <td width="60" align="center"><input name="active_{id_category}" type="checkbox" value="1" {active}/></td>
            <td width="60" align="center"><input type="text" name="thu_tu_{id_category}" id="thu_tu" class="orderbox" value="{thu_tu}"/></td>
            <td align="center"><a href="{link_update}"><img src="images/tools.png" border="0" /></a></td>
            <td align="center"><a href="javascript:ConfirmDeleteCat('{id_category}')" ><img src="images/trash.png" border="0" /></a></td>
          </tr>
        <!-- END BLOCK : list_cat -->
         
          <tr>
            <th align="center"><input name="" type="checkbox" value=""  class="checkallitem" /></th>
            <th align="left"><a href="#" class="name"><div style="float:left" class="delall"><img src="images/icon_16_trash.png" width="24" height="24" align="absmiddle" border="0" />&nbsp;Xóa những mục đã chọn</div></a></th>
            <th colspan="2" align="center"><input type="submit" class="btnadmin" name="button" id="button" value="Cập nhật" /></th>
            <th align="center">&nbsp;</th>
            <th>&nbsp;</th>
          </tr>
      </table>
		<div id="bottomtable"></div>
 </form>
        <div style="clear:both; height:10px;"></div>
       
       <!-- END BLOCK : show_category -->
       <!-- START BLOCK : show_item -->
         <!-- item -->
        <div id="titlepage">
        	<div style="float:left"><img border="0" src="images/docs.png" width="24" height="24" align="absmiddle" style="margin-right:5px;" />Danh sách {item_name}</div>
            <div id="btnaddnewitem"><a href="?page={par_page}&code=11&pid={pid}&pitem={pitem}">Thêm mới {item_name} </a></div>
        </div>
         <div id="searchbar">
        <form action="?page={par_page}&code=18" method="post"	>
           <div style="float:left">&nbsp;  <input id="keyword" type="text" name="keyword" onBlur="if (keyword.value=='') keyword.value='Tên {item_name}...';" onFocus="if (keyword.value=='Tên {item_name}...') keyword.value=''" style="width:250px" value="Tên {item_name}..." class="textboxsearch"> 
            {parentid}
          </div>
         <div style="height:18px; width:28px; margin-left:10px; float:left"> <img src="images/go.jpg" width="28" height="18" align="baseline" style="margin-top:5px;" /></div>
         <div  style="clear:both"></div>
		</form>
         </div>
         <form action="?page={par_page}&code=15&pid={pid}&pitem={pitem}&p={p}" method="post" id="list_item">
   	  <table width="100%" border="0"  class="tablephoto">
       	
     <thead>
     
        <tr class="searchbar">
            <th colspan="4">&nbsp;</th>
        </tr>
	</thead>

    	
          <tr>
            <td colspan="4" align="center">
           
            <!-- START BLOCK : list_item -->
            	<div id="photo_cell" class="photo_id_{id}">
                	<a href="{link_edit}" class="show_image_thumb">{image}</a>
                	<div id="phototools">
                   	  <strong>{name}</strong><br />Size: {size}
                    	<div>
                        	<a href="{link_edit}"><img border="0" src="./images/tools.png" width="16" height="16" style="margin-right:10px;" /></a>
                            <a href="#" onclick="delete_image('{id}'); return false;"><img src="./images/trash.png" width="16" height="16" border="0" style="margin-right:10px;"/></a>
                            <input name="active_{id}" id="active_{id}" type="checkbox" value="1" {active}/><label for="active_{id}">Kích hoạt</label>
                        </div>
                        <div>Thứ tự&nbsp;<input name="thu_tu_{id}" type="text" class="orderbox"  value="{thu_tu}"/></div>
                  </div>
                </div> 
            <!-- END BLOCK : list_item -->
           
            </td>
          </tr>
       
        
          <tr class="bottomtable" >
            <th width="40" align="center"><input name="" type="checkbox" value=""  class="checkallitem" /></th>
            <th align="left">
            <div class="delall" style="float:left"><a href="#" onclick="return ConfirmDeleteMultiItem();"><img src="images/icon_16_trash.png" width="24" height="24" border="0" align="absmiddle" style="margin-right:5px" />Xóa những {item_name} đã chọn</a></div></th>
            <th colspan="2" align="center"><input type="submit" class="btnadmin" name="button" id="button" value="Cập nhật" /></th>
          </tr>

        </table>
        </form>
         <div id="pagebar" align="center">
         	<div style="margin:0 auto; text-align:center">{pages_items}</div>
         </div>
		<div id="bottomtable"></div>
        <!-- end item -->
        <!-- END BLOCK : show_item -->
    <!-- end table -->
 <script language="javascript">
		
function ConfirmDeleteCat(id)
 {
 	if(confirm('Bạn có thật sự muốn xóa không ?')){
		document.location='?page={par_page}&pid={pid}&p={p}&code=06&id='+id;
	}
	else	{
		return false;
	}
 }
 function ConfirmDeleteItem(id)
 {
 	if(confirm('Bạn có thật sự muốn xóa không ?')){
		document.location='?page={par_page}&pid={pid}&pitem={pitem}&code=16&id='+id;
	}
	else	{
		return false;
	}
 }
  function ConfirmDeleteMultiItem()
 {
	 var n=$('input.selectitem:checked').length;
	if(n>0){
		if(confirm('Bạn có thật sự muốn xóa không ?')){
			$('#list_item').attr('action','?page={par_page}&code=17&pid={pid}&pitem={pitem}');
			$('#list_item').submit();
		}
		else{
			return false;
		}
	}else{
		alert('Không có {item_name} nào được chọn!');	
	}
 }

	
	function delete_image(id){
		if(confirm('Bạn có thật sự muốn xóa không ?')){
			$('#photo_id_'+id).append('Deleting...');
			$('.photo_id_'+id).append('Deleting...');
			 $.get('index4.php?page=uploadfile_photo',
				{
				delete_image:'1',
				id:id
				},
			function(data) {
				$('#photo_id_'+id).remove();
				$('.photo_id_'+id).remove();
			});
		}else{
			return false;	
		}
	}
	
	
	$('#addnewitem').ajaxForm({
        beforeSubmit: function(a,f,o) {
            o.dataType = 'html';
            $('#image_back').append('<img src="images/pbar-ani.gif" width="180" height="10" class="status_image"  />');
        },
        success: function(data) {
		   $('#photo_id_').remove();
		   $('.status_image').remove();
            if (typeof data == 'object' && data.nodeType)
                data = elementToString(data.documentElement, true);
            else if (typeof data == 'object')
                data = objToString(data);
            $('#image_back').append('<div>'+ data +'</div>');
        }
    });
	$('#update_item_form').ajaxForm({
        beforeSubmit: function(a,f,o) {
            o.dataType = 'html';
            $('#image_back').append('<img src="images/pbar-ani.gif" width="180" height="10" class="status_image"  />');
        },
        success: function(data) {
		   $('#photo_id_').remove();
		   $('.status_image').remove();
            if (typeof data == 'object' && data.nodeType)
                data = elementToString(data.documentElement, true);
            else if (typeof data == 'object')
                data = objToString(data);
            $('#image_back').html('<div>'+ data +'</div>');
			$("."+$('.div_show_photo_upload').attr('id')+" .show_image_thumb").html(data);
        }
    });
</script>


<div></div>
 